344
---
title: "Dashboard example"
output:
flexdashboard::flex_dashboard:
orientation: row
vertical_layout: fill
social: ["menu"]
source_code: embed
theme:
version: 4
bootswatch: spacelab
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(palmerpenguins)#dataset
library(plotly)
library(DT)
library(fontawesome)
data("penguins")
```
Plots {data-navmenu="Pages"}
===================================================================
Sidebar {.sidebar}
-------------------------------------------------------------------
### Penguin stats
The number of penguins in the data is `r nrow(penguins)`
Row
-------------------------------------------------------------------
### Number of penguins
```{r}
valueBox(nrow(penguins), icon = "fa-linux")
```
Column {.tabset}
-------------------------------------------------------------------
### Scatterplot bill_length_mm vs bill_depth_mm,
```{r}
a <- penguins |>
ggplot(aes(bill_length_mm,
bill_depth_mm,
color = species)) +
geom_point()
ggplotly(a)
```
### Chart B
```{r}
penguins |>
ggplot(aes(flipper_length_mm,
fill = species)) +
geom_histogram()+
facet_wrap(~species)
```
### Chart C
```{r}
penguins |>
ggplot(aes(body_mass_g,
sex,
fill = sex)) +
geom_boxplot()
```
Data {data-navmenu="Pages"}
==================================================================
Column {data-width=650}
-----------------------------------------------------------------------
```{r}
penguins |> datatable(extensions = "Buttons",
options = list(dom = "Blfrtip",
buttons = c("copy",
"csv",
"excel",
"print")))
```